﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControl_TinTuc_DanhSach : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            TinTucBS tbs = new TinTucBS();
            if (Request.QueryString["cateid"] != null && !String.IsNullOrEmpty(Request.QueryString["cateid"]))
            {
                this.CollectionPager1.DataSource = tbs.getAll(Convert.ToInt32(Request.QueryString["cateid"]), 2).DefaultView;
            }
            else
            {
                this.CollectionPager1.DataSource = tbs.getAll(2).DefaultView;
            }
            this.CollectionPager1.BindToControl = this.DataList1;
            this.DataList1.DataSource = this.CollectionPager1.DataSourcePaged;
            this.DataList1.DataBind();
        }
    }
}